﻿using System;
using System.Collections.Generic;
using System.IO;

namespace SoftwareNinjas.NAnt.Tasks
{
    /// <summary>
    /// Represents some interesting properties of Visual Studio projects for use when processing them.
    /// </summary>
    public class Project
    {
        /// <summary>
        /// Initializes a new instance of <see cref="Project"/>, which is rooted at <paramref name="baseDirectory"/>
        /// and is called <paramref name="projectName"/>.
        /// </summary>
        /// 
        /// <param name="projectName">
        /// The name of the project.
        /// </param>
        /// 
        /// <param name="folder">
        /// The path to the project.  This folder should contain <c><paramref name="projectName"/>.csproj</c>.
        /// </param>
        /// 
        /// <param name="language">
        /// The programming language used by the source code inside the project.
        /// </param>
        /// 
        /// <param name="references">
        /// The files representing re-usable code libraries referenced by the project.
        /// </param>
        /// 
        /// <param name="outputName">
        /// The name of the file (assembly or JAR) that will be generated by the project.
        /// </param>
        public Project(string projectName, string folder, SupportedLanguage language, IList<FileInfo> references,
            string outputName)
        {
            _name = projectName;
            _folder = folder;
            _language = language;
            _references = references;
            _outputName = outputName;
        }

        private readonly string _name;
        /// <summary>
        /// The name of the project.
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
        }

        private readonly string _folder;
        /// <summary>
        /// The project's base folder.
        /// </summary>
        public string Folder
        {
            get
            {
                return _folder;
            }
        }

        private readonly SupportedLanguage _language;
        /// <summary>
        /// The programming language for the project.
        /// </summary>
        public SupportedLanguage Language
        {
            get
            {
                return _language;
            }
        }

        private readonly IList<FileInfo> _references;
        /// <summary>
        /// The class libraries (.NET assemblies or Java JARs) used by the project.
        /// </summary>
        public IList<FileInfo> References
        {
            get
            {
                return _references;
            }
        }

        private readonly string _outputName;
        /// <summary>
        /// The name of the output file generated by the project.
        /// </summary>
        public string OutputName
        {
            get
            {
                return _outputName;
            }
        }
    }
}
